import { Ctx, Next } from '../types';


/**
 * 生成唯一「cookie」用于限制请求访问
 *
 * @export
 * @param {Ctx} ctx
 * @param {Next} next
 */
export async function createRequestCookie(ctx: Ctx, next: Next) {
  const requestCookie = ctx.request.header;
  if(!requestCookie) ctx.set('Set-Cookie', '2');
  await next();
}

/**
 * 用户限流访问
 * 
 * @export
 * @param {Ctx} ctx
 * @param {Next} next
 */
export async function validatorRouterLimiting(ctx: Ctx, next: Next) {

}